<!DOCTYPE html>
<!-- saved from url=(0052)http://getbootstrap.com/docs/4.0/examples/dashboard/ -->
<html lang="en" xmlns:th="http://www.thymeleaf.org">

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
		<meta name="description" content="">
		<meta name="author" content="">
		<title>菜品列表</title>
		<!-- Bootstrap core CSS -->
		<link href="../../../css/bootstrap.min.css" rel="stylesheet">
		<!-- Custom styles for this template -->
		<link href="../../../css/dashboard.css" rel="stylesheet">
		<style type="text/css">
			/* Chart.js */
			@-webkit-keyframes chartjs-render-animation {
				from {
					opacity: 0.99
				}
				to {
					opacity: 1
				}
			}
			
			@keyframes chartjs-render-animation {
				from {
					opacity: 0.99
				}
				to {
					opacity: 1
				}
			}
			
			.chartjs-render-monitor {
				-webkit-animation: chartjs-render-animation 0.001s;
				animation: chartjs-render-animation 0.001s;
			}
		</style>
	</head>

	<body>
		<!--顶部菜单 -->
		<div th:replace="~{topleft::topnav}"></div>
		<div class="container-fluid">
			<div class="row">
				<!--左菜单 -->
				<div th:replace="~{topleft::#sidebarMenu(lurl='leftuser')}"></div>
				<main role="main" class="col-md-9 ml-sm-auto col-lg-10 pt-3 px-4">
					<h2><a class="btn btn-success btn-sm" href="#" th:href="@{/toAddCaipin}">添加菜品</a></h2>
					<div class="table-responsive">
						<form action="#" th:action="@{/clist}" method="get">
							<label>名称:<input type="text" name="name" th:value="${name}"/>&nbsp;
								价格:<input type="text" name="price" th:value="${price}"/>&nbsp</label>
							<button type="submit" class="btn btn-success btn-sm" value="搜索">搜索</button>
						</form>
						<table class="table table-sm table-hover table-bordered">
							<thead>
							<tr>
								<th>编号</th>
								<th>名称</th>
								<th>价格</th>
								<th>数量</th>
								<th>操作</th>
							</tr>
							</thead>
							<tbody>
							<tr th:each="caipingoumaiEntity:${clist}">
								<td th:text="${caipingoumaiEntity.id}"></td>
								<td th:text="${caipingoumaiEntity.name}"></td>
								<td th:text="${caipingoumaiEntity.price}"></td>
								<td th:text="${caipingoumaiEntity.number}"></td>
								<td class="center">
									<a class="btn btn-success btn-sm" href="#" th:href="@{/selectCById/}+${caipingoumaiEntity.id}">查看</a>
									<a class="btn btn-info btn-sm" href="#" th:href="@{/toUpdateCaipin/}+${caipingoumaiEntity.id}">修改</a>
									<a class="btn btn-danger btn-sm" href="#" th:href="@{/delCaipin/}+${caipingoumaiEntity.id}">删除</a>
								</td>
							</tr>
							</tbody>
						</table>
						<nav aria-label="Page navigation example">
							<ul class="pagination">
								<li class="page-item">
									<a class="page-link" href="#"
									    th:href="@{/clist(pno=${page.navigateFirstPage},name=${name},price=${price})}" aria-label="Previous">
										<span aria-hidden="true">首页</span>
									</a>
								</li>
								<li class="page-item" th:if="${page.hasNextPage}">
									<a class="page-link" href="#"
									   th:href="@{/clist(pno=${page.nextPage},name=${name},price=${price})}">下页</a>
								</li>
								<li class="page-item" th:if="${page.hasPreviousPage}">
									<a class="page-link" href="#"
									   th:href="@{/clist(pno=${page.prePage},name=${name},price=${price})}">上页</a>
								</li>
								<li class="page-item">
									<a class="page-link" href="#"
									   th:href="@{/clist(pno=${page.navigateLastPage},name=${name},price=${price})}" aria-label="Next">
										<span aria-hidden="true">末页</span>
									</a>
								</li>
							</ul>
						</nav>
					</div>
				</main>
			</div>
		</div>

		<!-- Bootstrap core JavaScript
    ================================================== -->
		<!-- Placed at the end of the document so the pages load faster -->
		<script type="text/javascript" src="../../../js/jquery-3.3.1.min.js"></script>
		<script type="text/javascript" src="../../../js/popper.min.js"></script>
		<script type="text/javascript" src="../../../js/bootstrap.min.js"></script>

		<!-- Icons -->
		<script type="text/javascript" src="../../../js/feather.min.js"></script>
		<script>
			feather.replace()
		</script>

		<!-- Graphs -->
		<script type="text/javascript" src="../../../js/Chart.min.js"></script>
		<script>
			var ctx = document.getElementById("myChart");
			var myChart = new Chart(ctx, {
				type: 'line',
				data: {
					labels: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
					datasets: [{
						data: [15339, 21345, 18483, 24003, 23489, 24092, 12034],
						lineTension: 0,
						backgroundColor: 'transparent',
						borderColor: '#007bff',
						borderWidth: 4,
						pointBackgroundColor: '#007bff'
					}]
				},
				options: {
					scales: {
						yAxes: [{
							ticks: {
								beginAtZero: false
							}
						}]
					},
					legend: {
						display: false,
					}
				}
			});
		</script>

	</body>

</html>